package com.atguigu.lister.work;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by 小可乐$ on 2024/9/10$ 19:24$
 * description: 订阅模式消费者，一个生产者两个消费者
 */
@Component
public class RabbitMQDYLister {

    /**
     *消费者01
     */
    @RabbitListener(queues = {"atguigu.queue.fanout01"})
    public void processMessage01(String messageContent, Message message, Channel channel){
        System.out.println("fanout01"+messageContent);
    }

    /**
     *消费者02
     */
    @RabbitListener(queues = {"atguigu.queue.fanout02"})
    public void processMessage02(String messageContent, Message message, Channel channel){
        System.out.println("fanout02"+messageContent);
    }
}
